fix(sentry): filter TransformStream noise and close E2E detection gap for on_request_error events#1145
Merged
sw-factory-automations merged 1 commit intoMay 18, 2026
Conversation
… for on_request_error events Add TransformStream 'transformAlgorithm is not a function' to isNextjsInternalNoise — a known Node.js web streams race condition during SSR with no app code in the stack trace. Add isolation scope fallback to isE2ETestRequest. Next.js's captureRequestError sets request headers in sdkProcessingMetadata but not in event.request, and event.contexts.browser is enriched by Sentry's ingestion pipeline after beforeSend runs. The new fallback reads the scope's normalizedRequest headers directly. Closes #1144 Co-authored-by: Ona <no-reply@ona.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
✅ UI verification skipped — no UI files changed. This PR modifies only Sentry event filtering logic ( |
Collaborator
Author
|
✅ Post-merge verification passed. E2E tests (26/26 passed):
Ad-hoc smoke tests (all passed):
Skipped:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two related issues that allow noise to reach Sentry from E2E test sessions.
Sentry issue: https://ona-2j.sentry.io/issues/120744596/ (MEMO-2G)
Closes #1144
Root Cause
1. TransformStream noise —
TypeError: controller[kState].transformAlgorithm is not a functionis a known Node.js internal web streams race condition during SSR (vercel/next.js#68319, vercel/next.js#75994). Stack trace contains only Node.js internals — no app code. Not fixable in our codebase.2. E2E filter gap — Next.js's
captureRequestError(onRequestErrorhook) sets request headers inscope.sdkProcessingMetadata.normalizedRequestbut does NOT populateevent.request. Sentry's ingestion pipeline enrichesevent.contexts.browserafterbeforeSendruns on the server. SoisE2ETestRequesthad no way to detect HeadlessChrome foron_request_errorevents.Changes
src/lib/sentry/event-filters.ts— AddtransformAlgorithm is not a functiontoNEXTJS_INTERNAL_NOISE_PATTERNSsrc/lib/sentry/e2e-detection.ts— Add isolation scope fallback: readgetIsolationScope().getScopeData().sdkProcessingMetadata.normalizedRequest.headersfor HeadlessChrome detection whenevent.requestis null andevent.contexts.browseris unavailablesrc/lib/sentry/sentry.unit.test.ts— 9 new tests covering TransformStream filtering, scope-based E2E detection (positive/negative), andshouldDropServerEventintegration.agents/conventions.md— Document the four-source E2E detection strategyTest Results
pnpm lint && pnpm typecheck && pnpm test— all 1962 tests pass, 0 errors.